package com.zzptc.easyshop.dao;

import com.zzptc.easyshop.db.MysqlDB;
import com.zzptc.easyshop.vo.Users;
import com.zzptc.easyshop.vo.VO;

import java.sql.PreparedStatement;
import java.sql.SQLException;

import java.util.List;

public class UserDao implements IDAO{

    IDB db=new MydqlDB();
    @Override
    public boolean insert(VO vo) throws SQLException {
        MysqlDB conn=new MysqlDB();
        //执行游标
        PreparedStatement ps =conn.getConn().prepareStatement("insert into easybuy_user(eu_user_name,eu_password) values(?,?)");
        //
        Users users=(Users)vo;
        ps.setString(1,users.getEu_user_name());
        ps.setString(2,users.getEu_password());
        int i = ps.executeUpdate();
        return i>0;
    }

    @Override
    public boolean update(VO vo) throws SQLException {
        return false;
    }

    @Override
    public List getAll() throws SQLException {
        return null;
    }
}
